package util

import (
	"strconv"
)

func TypeToInterface(in map[string]string) map[string]interface{} {
	var out = make(map[string]interface{}, 0)

	for key, value := range in {
		switch value {
		case "TRUE", "True", "true":
			out[key] = true
		case "FALSE", "False", "false":
			out[key] = false
		default:
			out[key] = value
		}
	}

	return out
}

func ItoaEmptyZeao(i int) string {
	if i == 0 {
		return ""
	}

	return strconv.Itoa(i)
}